home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
boe.pres.k12.wv.us
/
boe.pres.k12.wv.us.zip
/
boe.pres.k12.wv.us
/
Utilities
/
Xerox Workcentre 5335
/
Windows Scan
/
64-bit_x64
/
Russian
/
cpsimage.cab
/
data
/
xipScripts
/
imsView.elf
< prev
next >
Wrap
Text File
|
2009-04-23
|
2KB
|
67 lines
/* @imsView
// DESCRIPTION
Read XOG IMS (Intermediate MRC Stream) format image file or
XIPIMAGE object file and display the contents via spd. It will
produce a display for each layer in the file where the title of
the window has the layer value starting at zero.
By default it will read and display all raster layers. To view
a specific layer use the layer import variable.
// EXAMPLES
IMS file:
> xipe xipScripts/imsView.elf -im infile:s filename
or
> xipe xipScripts/imsView.elf -im infile:s filename layer:i n
OBJECT file:
> xipe xipScripts/imsView.elf -im objfile:s filename
or
> xipe xipScripts/imsView.elf -im objfile:s filename layer:i n
*/
/* Script to view layers in IMS image */
LoadClasses (filename: "xeng");
IMPORT STRING infile;
IMPORT STRING objfile;
IMPORT INTEGER layer;
if ( !infile && !objfile )
{ print "need import of infile:s name || objfile:s name"; end; }
if ( infile )
XIPIMAGE img = ReadIMS (filename: infile);
else if ( objfile )
XIPIMAGE img = ReadObject (filename: objfile);
if (!img || img.Type() != "XIPIMAGE" )
{ print "invalid object type, expect XIPIMAGE got "+img.Type(); end; }
INTEGER ltype, i, j;
if ( layer ) {
ltype = img.getMember (num:layer, member:"layerType");
if ( ( ltype == XIP_Contone || ltype == XIP_ContoneMask ||
ltype == XIP_ColorMask || ltype == XIP_Binary ) )
img.getLayer (num:layer).unCompress(
).display(command: "spd -nogamma -title layer" + layer);
}
else {
for (j=0; j<img.nlayers; j++) {
// Layertype has to be a raster
ltype = img.getMember (num:j, member:"layerType");
if ( !( ltype == XIP_Contone || ltype == XIP_ContoneMask ||
ltype == XIP_ColorMask || ltype == XIP_Binary ) )
continue;
try {
img.getLayer (num:j).unCompress().display(command: "spd -nogamma -title layer" + j);
} catch {
print "failed on layer " + j;
}
}
}